package com.ruoyi.merchant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 支付方式枚举
 */
@Getter
@AllArgsConstructor
public enum PaymentMethodEnum {
    
    WECHAT(1, "微信支付"),
    ALIPAY(2, "支付宝"),
    BANK_CARD(3, "银行卡"),
    BALANCE(4, "余额");
    
    private final Integer code;
    private final String desc;
    
    public static String getDescByCode(Integer code) {
        if (code == null) {
            return "";
        }
        for (PaymentMethodEnum method : values()) {
            if (method.getCode().equals(code)) {
                return method.getDesc();
            }
        }
        return "";
    }
}
